#include <QApplication>
#include <QQmlContext>
#include <QQmlEngine>
#include <QObject>
#include "loginview.h"
#include "controllerview.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QApplication::setQuitOnLastWindowClosed(false);

    LoginView login;
    ControllerView contrview;
        login.rootContext()->setContextProperty("contrView", &contrview);
        login.setSourceAndRegsiterObj(QUrl("qrc:/login.qml"),true);
        QObject::connect(login.engine(), SIGNAL(quit()), &app, SLOT(quit()));
        login.show();
        login.showTrayIcon();

        contrview.setSourceAndRegsiterObj(QUrl("qrc:/contr.qml"),true);
        QObject::connect(contrview.engine(), SIGNAL(quit()), &app, SLOT(quit()));
        contrview.hide();

    return app.exec();
}
